<?php

namespace app\controller;

use app\BaseController;
use think\Exception;
use think\facade\Cache;
use think\facade\Config;
use think\facade\Db;
use think\helper\Str;
use think\facade\Log;
use mikkle\tp_wechat\Wechat;
use think\facade\Request;

class SappController extends BaseController
{

    protected static $url = 'kouzhao.wanglanglang.com';

    public function login(Request $request)
    {
        $param = $request::header();
        $option = Config::get('sst_options_name');
        $app = Wechat::sapp($option);
        $list = $app->login($param['wx-code']);

        return $this->returnJson(200, '可以注册',$list);
    }

    public function getUserInfo(){

        return $this->returnJson(1001, '请先登录');
    }



}
